package com.vtmer.controller;

import com.vtmer.entity.RegistrationForm;
import com.vtmer.result.ResultVo;
import com.vtmer.result.impl.ResultCode;
import com.vtmer.service.RegistrationFormService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Optional;

/**
 * @author Sloent
 * @date 2022/09/26 19:27
 **/
@RestController
public class RegController {
    @Resource
    RegistrationFormService registrationFormService;

    @PostMapping("/reg")
    @Transactional
    public RegistrationForm reg(@Validated RegistrationForm registrationForm) {
        registrationFormService.reg(registrationForm);
        return registrationForm;
    }
}